{template 'common/header'}
<ul class="nav nav-tabs">
    <li{if $_GPC['do'] == 'code'} class="active"{/if}><a  href="{php echo $this->createWebUrl('code');}">{$awardtitle}奖品管理</a></li>
    <!--<li{if $_GPC['do'] == 'turnplate_set'} class="active"{/if}><a  href="{php echo $this->createWebUrl('turnplate_set');}">惩罚转盘</a></li>-->
</ul>


<div class="main">
	<div class="category">
	<div class="panel panel-default">
    <div class="panel-heading">
        活动奖品列表(<span style="color: #FF0000">{if $turntable == 2}不管抢红包活动重置多少次，奖品总量和剩余数量都不重置{/if}请先在回复规则列表添加活动规则，然后点击右侧添加奖品按钮</span>)
    </div>
                <div class="panel-body table-responsive">
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th width="100">序列ID</th>
                            <th width="200">活动规则</th>
                            {if $turntable == 2||$turntable == 3}
                            <th width="100">奖品总量</th>
                            <th width="100">剩余数量</th>
                            {else}
                            <th width="100">奖项数量</th>
                            {/if}
                            <th width="200">奖品操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {loop $rowlist $row}
                        <tr>
                            <td>{$row['id']}</td>
                            <td>{$row['name']}</td>
                            {if $turntable == 2||$turntable == 3}
                            <td>{$row['awardstotal']}</td>
                            <td>
                                {php echo $row['awardstotal'] - $row['prizedraw']}
                            </td>
                            {else}
                            <td>{$row['total']}</td>
                            {/if}
                            <td>
                                <a href="{php echo $this->createWebUrl('Newcode',array('turntable' => $turntable,'rid' => $row['id']))}" class="btn btn-primary btn-sm"> 添加奖品</a>
                                <a href="{php echo $this->createWebUrl('codeshow', array('rid' => $row['id'],'turntable' => $turntable))}" class="btn btn-success btn-sm"> 查看奖品</a>
                                {if $turntable==1||$turntable == 3 ||$turntable == 4}
                                <a href="{php echo $this->createWebUrl('draw_default', array('rid' => $row['id'],'turntable' => $turntable))}" class="btn btn-success btn-sm"> 添加内定</a>
                                {/if}
                                {if $turntable == 3}
                                <a href="{php echo $this->createWebUrl('turnplate_set', array('rid' => $row['id']))}" class="btn btn-info btn-sm"> 惩罚大转盘设置</a>
                                 {/if}
                            </td>
                        </tr>
                        {/loop}
                        </tbody>
                    </table>
                </div>
            </div>
	</div>

</div>

		
{template 'common/footer'}